<!-- 图片题 -->
  <div class="form-group" style="margin-bottom: 15px;clear: both;">
    <span style="line-height: 30px;font-size: 14px;"><?=$itemTitle?></span>
    <p id="helpBlock<?=$itemId?>" class="" style="line-height: 30px;font-size: 14px;"><?=$itemDesc?></p>
    <div id="imgUpload<?=$itemId?>ImgBox" style="width: 200px;">
      <?php if (isset($value['viewPath']) && $value['viewPath']) {?>
      <div class="thumbnail" style="cursor: pointer;">
        <img class="carousel-inner img-responsive img-rounded img-preview" src="<?=$value['viewPath']?>">
      </div>
      <?php } ?>
    </div>
    <input type="hidden" id="imgUpload<?=$itemId?>ViewPath" name="<?=$inputName ? $inputName : 'actItem['.$itemId.'][viewPath]'?>" id="<?=$inputId ? $inputId : 'actItem['.$itemId.'][viewPath]'?>" value="<?=isset($value['viewPath'])?$value['viewPath']:''?>">
    <input type="hidden" id="imgUpload<?=$itemId?>FileId" name="<?=$inputName ? $inputName:'actItem['.$itemId.'][fileId]'?>" id="<?=$inputId ? $inputId : 'actItem['.$itemId.'][fileId]'?>" value="<?=isset($value['fileId'])?$value['fileId']:''?>">
    <?php if ($action !='check') {?>
    <input type="button" id="imgUpload<?=$itemId?>" accept=".xls,.doc,.txt,.pdf" value="上传图片" />
    <?php } ?>
    <?=$alias?>
  </div>
  <?php if ($action !='check') {?>
 <script type="text/javascript">
	KindEditor.ready(function(K) {
		var uploadbutton_<?=$itemId?> = K.uploadbutton({
			button : K('#imgUpload<?=$itemId?>')[0],
			fieldName : 'imgFile',
			url : '<?php echo $uploadUrl?>',
			extraParams:<?=$extraParams?jsonEncode($extraParams):jsonEncode(array())?>,
			afterUpload : function(data) {
				layer.closeAll('loading'); //关闭加载层
				if (data.error === 0) {
					if ($("#imgUpload<?=$itemId?>ImgBox").length > 0) {
						var url = K.formatUrl(data.url, 'absolute');
						var html = '<div class="thumbnail" style="cursor: pointer;"><img class="carousel-inner img-responsive img-rounded img-preview" src="'+url+'"></div>';
						$("#imgUpload<?=$itemId?>ImgBox").html(html);
						K('#imgUpload<?=$itemId?>ViewPath').val(url);
					};
					K('#imgUpload<?=$itemId?>FileId').val(data.fileId);
					layer.msg('图片上传成功', {icon: 1,time: 500});
				} else {
					layer.msg(data.message, {icon:4,shift: 5,time: 1000});
				}
			},
			afterError : function(str) {
				layer.msg('自定义错误信息: ' + str, {shift: 5,time: 1000});
			}
		});
		uploadbutton_<?=$itemId?>.fileBox.change(function(e) {
			var index = layer.load(1, {
			    shade: [0.5,'#fff'] //0.1透明度的白色背景
			});
			uploadbutton_<?=$itemId?>.submit();
		});
	});
</script>
<?php } ?>